import request from '@/utils/request'
import { CHECC_API_BASE_DATA } from '@/constants/proxy'
import {  ResponseDataPromise } from 'typings/interfaces'



// 获取财务主表信息列表
export function requestFinanceList(params: any, data: any): Promise<any> {
    return request({
        url: CHECC_API_BASE_DATA + `/bd-basic-financial-information/page`,
        method: 'post',
        data: data,
        params,
    })
}

export const deleteRecordsRequest = (ids: string[]): ResponseDataPromise<boolean> =>
  request({
    url: CHECC_API_BASE_DATA + `/bd-basic-financial-information`,
    method: 'delete',
    data: ids,
  })
  
// 获取财务历史信息列表
export function requestHistoryList(params: any, data: any): Promise<any> {
    return request({
        url: CHECC_API_BASE_DATA + `/bd-basic-financial-information-history/page`,
        method: 'post',
        data: data,
        params,
    })
}

// 保存、编辑、删除财务历史信息
export function IFinancialHistory(data: any, method: any): Promise<any> {
    return request({
        url: CHECC_API_BASE_DATA + `/bd-basic-financial-information-history`,
        method: method,
        data
    })
}

// 通过id查询历史信息数据
export function obtainHistory(data: any): Promise<any> {
    return request({
        url: CHECC_API_BASE_DATA + `/bd-basic-financial-information-history/${data}`,
        method: 'get',
    })
}


